package com.sbwebsocket.core.service.impl;

import com.sbwebsocket.core.model.bo.DirectMessageBody;
import com.sbwebsocket.core.service.MessageQueueAdapter;
import com.sbwebsocket.core.service.MessageTypePushProcess;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 推送给单个用户
 * @Auther: GSJ
 * @Date: 2022/2/10
 * @Description:
 * @version: 1.0
 */
public class DirectMessageTypePushProcess implements MessageTypePushProcess<DirectMessageBody> {

    @Autowired
    MessageQueueAdapter messageQueueAdapter;


    @Override
    public boolean process(DirectMessageBody message) {
        /**
         * step1:把消息组织成对应的格式扔到消息中件间里去
         *
         */
        return messageQueueAdapter.get(message).delivery(message);
    }
}
